﻿Imports System.ServiceModel

Public Class CommonWCFSupport
    Private Shared myBinding
    Private Shared myEndpointAddress

    Public Shared Function GetBindingInstance() As WSHttpBinding
        If myBinding Is Nothing Then
            myBinding = New WSHttpBinding()
        End If
        myBinding.Security.Mode = BasicHttpSecurityMode.Message
        'myBinding.Security.Message.AlgorithmSuite =System.Security.SecurityAlgorithmSuite.Default
        myBinding.Security.Message.ClientCredentialType = MessageCredentialType.Windows
        myBinding.Security.Message.NegotiateServiceCredential = True
        myBinding.Security.Message.EstablishSecurityContext = True
        Return myBinding
    End Function

    Public Shared Function GetEndpointAddress() As EndpointAddress
        If myEndpointAddress Is Nothing Then
            myEndpointAddress = New EndpointAddress(New Uri("http://localhost:2026/POSServiceHost/POSService.svc"))
        End If
        Return myEndpointAddress
    End Function
End Class
